using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Peradigm.Framework.UI.Web;
using Peradigm.Framework.Domain.Security;

using Liberty.Application.ApprovalManagement;
using Liberty.Domain;
using Liberty.Domain.ApprovalManagement;
using Liberty.UI;
using Liberty.UI.ApprovalManagement.Controls;

namespace Liberty.UI.ApprovalManagement
{
    public partial class ReminderListView : ThemedPage
    {
        #region Constants
        private const string SESSION_REMINDERS = "Session.Reminders";
        #endregion

        #region Event Handlers
        protected void Page_Load( object sender, EventArgs e )
        {
            if ( !this.IsPostBack )
            {
                ReminderController controller = new ReminderController();
                UserVariable user = new UserVariable();
                this.Reminders = controller.FollowUpEventsFor( user.User );
                ucReminderListView.Model = this.Reminders;
            }
            else
            {
                ucReminderListView.Model = this.Reminders;
            }
        }
        #endregion

        #region Private Methods
        #endregion

        #region Properties
        #endregion

        #region Methods
        protected override void UpdateView()
        {
            base.UpdateView();
            ( (Main)this.Master ).HideRemindersAction();
        }
        #endregion

        #region Private Methods
        #endregion

        #region Private Properties
        private List<FollowUpEvent> Reminders
        {
            get
            {
                List<FollowUpEvent> events = null;
                object sessionReminders = this.Session[SESSION_REMINDERS];
                if ( sessionReminders != null )
                {
                    events = (List<FollowUpEvent>)sessionReminders;
                }
                return events;
            }
            set
            {
                this.Session[SESSION_REMINDERS] = value;
            }
        }
        #endregion

        #region Construction and Finalization
        #endregion

        #region Data Elements
        #endregion
    }
}
